//
//  SRCardModel.m
//  SunriseReaderDemo
//
//  Created by 田宇 on 2024/11/27.
//  Copyright © 2024 Chenfan. All rights reserved.
//

#import "SRIDCardModel.h"

@implementation SRIDCardModel

- (id)initWithDic:(NSDictionary *)dic{
    if (self = [super init]) {
        _idNum = [dic objectForKey:@"idNum"];
        _birthday = [dic objectForKey:@"birthday"];
        _effectDate = [dic objectForKey:@"effectDate"];
        _expireDate = [dic objectForKey:@"expireDate"];
        _address = [dic objectForKey:@"address"];
        _gender = [dic objectForKey:@"gender"];
        _genderCode = [dic objectForKey:@"genderCode"];
        _nation = [dic objectForKey:@"nation"];
        _nationCode = [dic objectForKey:@"nationCode"];
        _name = [dic objectForKey:@"name"];
        _photo = [dic objectForKey:@"photo"];
        _dn = [dic objectForKey:@"dn"];
        _issueOrg = [dic objectForKey:@"issueOrg"];
        _name = [dic objectForKey:@"name"];
        if (_birthday.length >= 8) {
            _year = [_birthday substringWithRange:NSMakeRange(0, 4)];
            _mon = [_birthday substringWithRange:NSMakeRange(4, 2)];
            _day = [_birthday substringWithRange:NSMakeRange(6, 2)];            
        }
    }
 
    return self;
}

@end
